<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<form>
    <input type="text" id="user">
    <button id="btn" onclick="safe()">登陆</button>
</form>
<script>
    function safe(){
        var name = document.getElementById("user").value;
        if(name=="1"){//设置密码
            alert("密码正确");
           window.open("http://www.baidu.com");//外网ip地址


}else{
            alert("密码错误");
        }
    }

</script>
</body>
</html>